<template>
  <div class="stylechange">
    <el-image  class="mainlayout"  :src="require('@/assets/研究团队.png')" :fit="fit" @click.native="add1"/>
    <el-image class="mainlayout" :src="require('@/assets/论文下载.png')" :fit="fit" @click.native="add2"/>
    <el-image  class="mainlayout" :src="require('@/assets/研究方向.png')" :fit="fit" @click.native="add3"/>
   <el-image  class="mainlayout" :src="require('@/assets/新闻动态.png')" :fit="fit" @click.native="add4"/>
  </div>
  <el-dialog title="提示" v-model="dialogVisible" width="40%">
    <el-form :model="form" label-width="120px">
      <el-form-item label="题目">
        <el-input v-model="form.title" style="width: 80%"></el-input>
      </el-form-item>
    </el-form>
    <template #footer>
        <span slot="footer" class="dialog-footer">
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="save">确 定</el-button>
        </span>
    </template>
  </el-dialog>
</template>

<script>
import request from "@/utils/request";

export default {
  name: "StyleChange",
  data(){
    return{
      form:{},
      dialogVisible:false,
      url:"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
    }
  },
  methods:{
    add1(){
      this.form={};
      this.form.id=this.$route.query.pageId;
      this.form.kindId=1;
      this.dialogVisible=true;
    },
    add2(){
      this.form={};
      this.form.id=this.$route.query.pageId;
      this.form.kindId=2;
      this.dialogVisible=true;
    },
    add3(){
      this.form={};
      this.form.id=this.$route.query.pageId;
      this.form.kindId=3;
      this.dialogVisible=true;
    },
    add4(){
      this.form={};
      this.form.id=this.$route.query.pageId;
      this.form.kindId=4;
      this.dialogVisible=true;
    },
    save(){
      request.put("/menuList",this.form).then(res=>{
        if(res.code=='0'){
          this.$message({
            type:"success",
            message:"成功"
          })
          this.$router.push({path:'/WebPage'+this.form.kindId,query: {pageId:this.$route.query.pageId}});
        }else{
          this.$message({
            type:"error",
            message:res.msg
          })
        }
      })
    }
  }
}
</script>

<style scoped>
.stylechange{
  width: 80%;
  margin-left: 6%;
  padding-left: 10%;
  padding-right: 10%;
  padding-top: 3%;
}
.mainlayout{
  width:40%;
  height: 40%;
  margin-left: 10%;
  margin-top: 5%;
  cursor:pointer;
  border: silver;
  border-radius: 1vw;
}
</style>